package ioc.circular;

public class G {
  public G() {
    System.out.println("g 默认构造函数 hashcode:-----" + this.hashCode());
  }

  private H h;

  public H getH() {
    return h;
  }

  public void setH(H h) {
    System.out.println("-----给g设置的h的hashcode:" + h.hashCode());
    this.h = h;
  }

  @Override
  public String toString() {
    return "G{" + this.hashCode() +
            " H=" + h.hashCode() + " h的g=" + h.getG()
            .hashCode() +
            '}';
  }
}
